package com.imooc.config;

import com.imooc.service.OrderService;
import com.imooc.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * <h1>cron.qqe2.com</h1>
 *
 * @author : dzj
 * @create: 2022-03-30 17:52
 */
@Component
@Slf4j
public class OrderJob {
    @Autowired
    private OrderService orderService;

    @Scheduled(cron = "0 0 0/1 * * ?")
    public void autoCloseOrder() {
        orderService.closeOrder();
        //log.debug("执行定时任务, 当前时间为:{}", DateUtil.getCurrentDateString(DateUtil.DATETIME_PATTERN));
    }
}
